﻿using Microsoft.AspNetCore.Mvc;
using ZH.GPT.Version;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using static ZH.GPT.Version.CustomApiVersion;

namespace ZH.GPT.Controllers.v2
{
    /// <summary>
    /// 用户控制器
    /// </summary>
    //MVC自带特性 对 api 进行组管理
    //[ApiExplorerSettings(GroupName = "v2")]
    //[Route("api/v2/user")]

    //和上边的版本控制以及路由地址都是一样的
    [CustomRoute(ApiVersions.V2, "User")]
    [ApiController]
    public class UserController : ControllerBase
    {
        ///// <summary>
        ///// 获取用户信息,根据id
        ///// </summary>
        ///// <param name="id">编号</param>
        ///// <returns></returns>
        //[HttpGet("getuser/{id}")]
        //public string GetUser(string id)
        //{
        //    return id;
        //}

        ///// <summary>
        ///// 获取用户信息,根据id[FromRoute]
        ///// </summary>
        ///// <param name="id">编号</param>
        ///// <returns></returns>
        //[HttpGet("getuserFromRoute/{id}")]
        //public string GetUserFromRoute([FromRoute] string id)
        //{
        //    return id;
        //}

        ///// <summary>
        ///// 获取用户信息,根据id[FromQuery]
        ///// </summary>
        ///// <param name="id">编号</param>
        ///// <returns></returns>
        //[HttpGet("getuserFromQuery")]
        //public string GetUserFromQuery([FromQuery] string id)
        //{
        //    return id;
        //}

        ///// <summary>
        ///// 获取用户信息,根据id[FromForm]
        ///// </summary>
        ///// <param name="id">编号</param>
        ///// <returns></returns>
        //[HttpPost("getuserFromForm")]
        //public string GetUserFromForm([FromForm] string id)
        //{
        //    return id;
        //}

        ///// <summary>
        ///// 获取用户信息,根据id[FromBody]
        ///// </summary>
        ///// <param name="id">编号</param>
        ///// <returns></returns>
        //[HttpPost("getuserFromBody")]
        //public string GetUserFromBody([FromBody] string id)
        //{
        //    return id;
        //}

        ///// <summary>
        ///// 获取用户信息,根据id[FromHeader]
        ///// </summary>
        ///// <param name="id">编号</param>
        ///// <returns></returns>
        //[HttpGet("getuserFromHeader")]
        //public string GetUserFromHeader([FromHeader] string id)
        //{
        //    return id;
        //}
 
    
    }
}
